package com.qf.web.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @date 2022/3/31
 * @desc 封装json对象
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class R<T> {

    private Integer code;

    private String msg;

    private T data;

    private long count;

    public static  R ok() {
        R r = new R(0, "success",null,0);
        return  r;

    }
    public  static R ok(Integer code,String msg){
        R r = new R();
        r.setCode(code);
        r.setMsg(msg);
        return r;
    }
    public static  R error() {
        R r = new R(-1, "error", null,0);
        return  r;
    }

}